#ifndef QOUSERMANAGER_H
#define QOUSERMANAGER_H

/**
* @file qousermanager.h
* @describe 用户管理类
* @author gaoyuelong
* @date 2022/05/07
*/


#include "qouser.h"
#include <memory>
#include <QVector>
#include <QObject>

//管理用户，保存当前登录用户
class QoUserManager : public QObject
{
    Q_OBJECT
public:
    static QoUserManager* getInstance();

    //void setCurrentUser(QoUser);
    //如何返回一个不可修改的user对象
    const std::shared_ptr<QoUser> getCurrentUser() const;

    void setCurrentUserFriends(const QVector<QoUser> &);
    QVector<QoUser> &getCurrentUserFriends();


signals:

public slots:

private:
    explicit QoUserManager(QObject *parent = nullptr);

    //维护一个当前的User对象
    std::shared_ptr<QoUser> m_pCurrentUser;

    //当前用户的
    QVector<QoUser> m_vecCurrentUserFriends;
};

#endif // QOUSERMANAGER_H
